package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosActionMappingMapper;
import com.ruoyi.net.domain.ElementQosActionMapping;
import com.ruoyi.net.service.IElementQosActionMappingService;

/**
 * 网元-QOS配置-流行为-重映射配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosActionMappingServiceImpl implements IElementQosActionMappingService 
{
    @Autowired
    private ElementQosActionMappingMapper elementQosActionMappingMapper;

    /**
     * 查询网元-QOS配置-流行为-重映射配置
     * 
     * @param id 网元-QOS配置-流行为-重映射配置主键
     * @return 网元-QOS配置-流行为-重映射配置
     */
    @Override
    public ElementQosActionMapping selectElementQosActionMappingById(String id)
    {
        return elementQosActionMappingMapper.selectElementQosActionMappingById(id);
    }

    /**
     * 查询网元-QOS配置-流行为-重映射配置列表
     * 
     * @param elementQosActionMapping 网元-QOS配置-流行为-重映射配置
     * @return 网元-QOS配置-流行为-重映射配置
     */
    @Override
    public List<ElementQosActionMapping> selectElementQosActionMappingList(ElementQosActionMapping elementQosActionMapping)
    {
        return elementQosActionMappingMapper.selectElementQosActionMappingList(elementQosActionMapping);
    }

    /**
     * 新增网元-QOS配置-流行为-重映射配置
     * 
     * @param elementQosActionMapping 网元-QOS配置-流行为-重映射配置
     * @return 结果
     */
    @Override
    public int insertElementQosActionMapping(ElementQosActionMapping elementQosActionMapping)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosActionMapping.getId())) {
            elementQosActionMapping.setId(uuid);
        }
        elementQosActionMapping.setCreateBy(SecurityUtils.getUsername());
        elementQosActionMapping.setCreateTime(DateUtils.getNowDate());
        elementQosActionMapping.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionMapping.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionMappingMapper.insertElementQosActionMapping(elementQosActionMapping);
    }

    /**
     * 修改网元-QOS配置-流行为-重映射配置
     * 
     * @param elementQosActionMapping 网元-QOS配置-流行为-重映射配置
     * @return 结果
     */
    @Override
    public int updateElementQosActionMapping(ElementQosActionMapping elementQosActionMapping)
    {
        elementQosActionMapping.setUpdateBy(SecurityUtils.getUsername());
        elementQosActionMapping.setUpdateTime(DateUtils.getNowDate());
        return elementQosActionMappingMapper.updateElementQosActionMapping(elementQosActionMapping);
    }

    /**
     * 批量删除网元-QOS配置-流行为-重映射配置
     * 
     * @param ids 需要删除的网元-QOS配置-流行为-重映射配置主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionMappingByIds(String[] ids)
    {
        return elementQosActionMappingMapper.deleteElementQosActionMappingByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流行为-重映射配置信息
     * 
     * @param id 网元-QOS配置-流行为-重映射配置主键
     * @return 结果
     */
    @Override
    public int deleteElementQosActionMappingById(String id)
    {
        return elementQosActionMappingMapper.deleteElementQosActionMappingById(id);
    }
}
